.form
  .box เปลี่ยนรหัสผ่าน
  - form_tag( {:action=>:reset_password}, {:id=>'form'} ) do
    %table
      %tr
        %td ชื่อบัญชี: &nbsp;
        %td{:width=>'350'}= text_field_tag 'username', @u.login, :disabled=>true
      %tr
        %td รหัสผ่านเดิม: &nbsp;
        %td= password_field_tag 'password', nil
      %tr
        %td รหัสผ่านใหม่: &nbsp;
        %td= password_field_tag 'new_password', nil
      %tr
        %td ยืนยันรหัสผ่านใหม่: &nbsp;
        %td
          = password_field_tag 'confirm_new_password', nil, :onChange => "validate_password()"
          %span{:id=>:msg}
      %tr
        %td{:colspan=>'2', :align=>:center}
          %br
          = submit_tag 'เปลี่ยนรหัสผ่านใหม่', :name => :cmdSubmit
  %script
    $('form').password.focus();
    function validate_password(){
    if($('form').new_password.value!=$('form').confirm_new_password.value) {
    document.getElementById('msg').innerHTML='<font color=red>รหัสใหม่ไม่ตรงกัน</font>';
    $('form').cmdSubmit.disabled = true;
    } else {
    document.getElementById('msg').innerHTML='';
    $('form').cmdSubmit.disabled = false;
    }
    }